//千年虫?
let y = 2020
let m = 6
let days = 0
switch (m) {
    case 2:
        days = y % 400 === 0 || (y % 4 === 0 && y % 100 !== 0) ? 29 : 28
        break
    case 4:
    case 6:
    case 9:
    case 11:
        days = 30
        break
    default:
        days = 31
        break
}

console.log(`${y}年${m}月有${days}天`)


let ds = new Date(y,m,0).getDate()
console.log(`${y}年${m}月有${ds}天`)
